"""
model: 3_常用数据类型 libat
author: Mr_52Hz
date: 2019-07-21
"""
from utils.test_tools import test_decorator


@test_decorator('test list')
def test_list():
    # 测试列表的浅拷贝和赋值
    a = [1, 2, 3]
    # 赋值时发生浅拷贝-将a的地址赋值给b
    b = a
    print(id(a), id(b))
    b.append(5)
    # a b指向同一内存地址
    print(a, b)
    print(id(a), id(b))

    # b发生新的赋值-获得新的地址
    b = [1]
    print(a, b)
    print(id(a), id(b), id([1]))


if __name__ == '__main__':
    test_list()




